# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-httpx
pkgver=0.27.0
pkgrel=1
pkgdesc="Next generation HTTP client for Python"
url="https://www.python-httpx.org/"
license="BSD-3-Clause"
arch="noarch"
depends="
	py3-certifi
	py3-httpcore
	py3-idna
	py3-sniffio
	"
makedepends="
	py3-gpep517
	py3-hatchling
	"
checkdepends="
	py3-chardet
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-trio
	py3-socksio
	py3-trustme
	uvicorn
	"
subpackages="$pkgname-pyc"
source="https://github.com/encode/httpx/archive/$pkgver/py3-httpx-$pkgver.tar.gz
	remove-fancy-pypi-readme.patch
	"
builddir="$srcdir/httpx-$pkgver"
options="!check" # cyclic dependency on uvicorn

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH="$PWD/build/lib" pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/httpx-$pkgver-py3-none-any.whl
}

sha512sums="
9db19cced6554effdb5fb0b442cbe05dc66cbfbdb23e8fbc19f43e1acc81028bca9e0fba5d2dae617b19be9f64baa0f02e727e92fef3f3f1288aa19ae07f35c6  py3-httpx-0.27.0.tar.gz
cd6107db2fb6123ad952537cef8b45c7896cf370807ad79c1ca355aee8e0fb32718db5de4c12075da2126d9e47d915ed30c40a9fe6aebe5aa04d33c9e99c1d9c  remove-fancy-pypi-readme.patch
"
